/*
 * @(#)QueryResult.java        0.1 13-Feb-2009
 *
 * Copyright 2008 Thomas Ford. All rights reserved.
 */


package edu.napier.soc.xfdm.parser;

import java.util.Collections;
import java.util.List;

/**
 * @author Thomas Ford
 * @version 0.1, 13-Feb-2009
 */
public class QueryResult {

	private final List<?> columnNames;
	private final Object[][] rows;
	private final String query;

	public QueryResult(String query, List<?> columnNames,
	                   Object[][] rows) {
		this.columnNames = columnNames;
		this.rows = rows;
		this.query = query;
	}

	public QueryResult(String query, List<?> columnNames,
	                   Object[] rows) {
		this.columnNames = columnNames;
		this.rows = new Object[1][];
		this.rows[0] = rows;
		this.query = query;
	}

	public List<Object> getColumnNames() {
		return Collections.unmodifiableList(columnNames);
	}

	public Object[][] getRows() {
		return rows;
	}

	public String getQuery() {
		return query;
	}
}
